package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the customer database table.
 * 
 */
@Entity
@NamedQuery(name="Customer.findAll", query="SELECT c FROM Customer c")
public class Customer implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="cus_id")
	private int cusId;

	@Column(name="ad_id")
	private int adId;
	
	@Column(name="cus_img")
	private String cusimg;

	@Column(name="cus_company")
	private String cusCompany;

	@Temporal(TemporalType.DATE)
	@Column(name="cus_credate")
	private Date cusCredate;

	@Temporal(TemporalType.DATE)
	@Column(name="cus_firstdate")
	private Date cusFirstdate;

	@Column(name="cus_name")
	private String cusName;

	@Column(name="cus_other_contact")
	private String cusOtherContact;

	@Column(name="cus_remark")
	private String cusRemark;

	@Column(name="cus_show")
	private int cusShow;


	//bi-directional many-to-one association to Anniversary
	@OneToMany(mappedBy="customer")
	private List<Anniversary> anniversaries;
	
	//bi-directional many-to-one association to Anniversary
	@OneToMany(mappedBy="customer")
	private List<Logforcust> logforcust;
	

	//bi-directional many-to-one association to Backlog
	@OneToMany(mappedBy="customer")
	private List<Backlog> backlogs;

	//bi-directional many-to-one association to Care
	@OneToMany(mappedBy="customer")
	private List<Care> cares;

	//bi-directional many-to-one association to Competitor
	@OneToMany(mappedBy="customer")
	private List<Competitor> competitors;

	//bi-directional many-to-one association to Complaint
	@OneToMany(mappedBy="customer")
	private List<Complaint> complaints;

	//bi-directional many-to-one association to Cusmshift
	@OneToMany(mappedBy="customer")
	private List<Cusmshift> cusmshifts;

	//bi-directional many-to-one association to Addresdetail
	@ManyToOne
	@JoinColumn(name="cus_unitaddress")
	private Addresdetail addresdetail;

	//bi-directional many-to-one association to Affix
	@ManyToOne
	@JoinColumn(name="affix_id")
	private Affix affix;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="node_ation")
	private Dictionary dictionary1;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="node_score")
	private Dictionary dictionary2;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="cus_credit")
	private Dictionary dictionary3;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="node_qualitative")
	private Dictionary dictionary4;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="cus_status")
	private Dictionary dictionary5;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="cus_type")
	private Dictionary dictionary6;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user;

	//bi-directional many-to-one association to Customerconsolidation
	@OneToMany(mappedBy="customer1")
	private List<Customerconsolidation> customerconsolidations1;

	//bi-directional many-to-one association to Customerconsolidation
	@OneToMany(mappedBy="customer2")
	private List<Customerconsolidation> customerconsolidations2;

	//bi-directional many-to-one association to Deliveryschedule
	@OneToMany(mappedBy="customer")
	private List<Deliveryschedule> deliveryschedules;

	//bi-directional many-to-one association to Demand
	@OneToMany(mappedBy="customer")
	private List<Demand> demands;

	//bi-directional many-to-one association to Linkman
	@OneToMany(mappedBy="customer")
	private List<Linkman> linkmans;

	//bi-directional many-to-one association to Node
	@OneToMany(mappedBy="customer")
	private List<Node> nodes;

	//bi-directional many-to-one association to Offer
	@OneToMany(mappedBy="customer")
	private List<Offer> offers;

	//bi-directional many-to-one association to Opportunity
	@OneToMany(mappedBy="customer")
	private List<Opportunity> opportunitys;

	//bi-directional many-to-one association to Orderform
	@OneToMany(mappedBy="customer")
	private List<Orderform> orderforms;

	//bi-directional many-to-one association to Orderlog
	@OneToMany(mappedBy="customer")
	private List<Orderlog> orderlogs;

	//bi-directional many-to-one association to Repairlist
	@OneToMany(mappedBy="customer")
	private List<Repairlist> repairlists;

	//bi-directional many-to-one association to Returne
	@OneToMany(mappedBy="customer")
	private List<Returne> returnes;

	//bi-directional many-to-one association to Service
	@OneToMany(mappedBy="customer")
	private List<Service> services;

	//bi-directional many-to-one association to Solution
	@OneToMany(mappedBy="customer")
	private List<Solution> solutions;

	public Customer() {
	}

	public int getCusId() {
		return this.cusId;
	}

	public void setCusId(int cusId) {
		this.cusId = cusId;
	}

	public int getAdId() {
		return this.adId;
	}

	public void setAdId(int adId) {
		this.adId = adId;
	}

	public String getCusCompany() {
		return this.cusCompany;
	}

	public void setCusCompany(String cusCompany) {
		this.cusCompany = cusCompany;
	}

	
	public String getCusimg() {
		return cusimg;
	}

	public void setCusimg(String cusimg) {
		this.cusimg = cusimg;
	}

	public Date getCusCredate() {
		return this.cusCredate;
	}

	public void setCusCredate(Date cusCredate) {
		this.cusCredate = cusCredate;
	}

	public Date getCusFirstdate() {
		return this.cusFirstdate;
	}

	public void setCusFirstdate(Date cusFirstdate) {
		this.cusFirstdate = cusFirstdate;
	}

	public String getCusName() {
		return this.cusName;
	}

	public void setCusName(String cusName) {
		this.cusName = cusName;
	}

	public String getCusOtherContact() {
		return this.cusOtherContact;
	}

	public void setCusOtherContact(String cusOtherContact) {
		this.cusOtherContact = cusOtherContact;
	}

	public String getCusRemark() {
		return this.cusRemark;
	}

	public void setCusRemark(String cusRemark) {
		this.cusRemark = cusRemark;
	}

	public int getCusShow() {
		return this.cusShow;
	}

	public void setCusShow(int cusShow) {
		this.cusShow = cusShow;
	}

	public List<Anniversary> getAnniversaries() {
		return this.anniversaries;
	}

	public void setAnniversaries(List<Anniversary> anniversaries) {
		this.anniversaries = anniversaries;
	}

	public Anniversary addAnniversary(Anniversary anniversary) {
		getAnniversaries().add(anniversary);
		anniversary.setCustomer(this);

		return anniversary;
	}

	public Anniversary removeAnniversary(Anniversary anniversary) {
		getAnniversaries().remove(anniversary);
		anniversary.setCustomer(null);

		return anniversary;
	}

	public List<Backlog> getBacklogs() {
		return this.backlogs;
	}

	public void setBacklogs(List<Backlog> backlogs) {
		this.backlogs = backlogs;
	}

	public Backlog addBacklog(Backlog backlog) {
		getBacklogs().add(backlog);
		backlog.setCustomer(this);

		return backlog;
	}

	public Backlog removeBacklog(Backlog backlog) {
		getBacklogs().remove(backlog);
		backlog.setCustomer(null);

		return backlog;
	}

	public List<Care> getCares() {
		return this.cares;
	}

	public void setCares(List<Care> cares) {
		this.cares = cares;
	}

	public Care addCare(Care care) {
		getCares().add(care);
		care.setCustomer(this);

		return care;
	}

	public Care removeCare(Care care) {
		getCares().remove(care);
		care.setCustomer(null);

		return care;
	}

	public List<Competitor> getCompetitors() {
		return this.competitors;
	}

	public void setCompetitors(List<Competitor> competitors) {
		this.competitors = competitors;
	}

	public Competitor addCompetitor(Competitor competitor) {
		getCompetitors().add(competitor);
		competitor.setCustomer(this);

		return competitor;
	}

	public Competitor removeCompetitor(Competitor competitor) {
		getCompetitors().remove(competitor);
		competitor.setCustomer(null);

		return competitor;
	}

	public List<Complaint> getComplaints() {
		return this.complaints;
	}

	public void setComplaints(List<Complaint> complaints) {
		this.complaints = complaints;
	}

	public Complaint addComplaint(Complaint complaint) {
		getComplaints().add(complaint);
		complaint.setCustomer(this);

		return complaint;
	}

	public Complaint removeComplaint(Complaint complaint) {
		getComplaints().remove(complaint);
		complaint.setCustomer(null);

		return complaint;
	}

	public List<Cusmshift> getCusmshifts() {
		return this.cusmshifts;
	}

	public void setCusmshifts(List<Cusmshift> cusmshifts) {
		this.cusmshifts = cusmshifts;
	}

	public Cusmshift addCusmshift(Cusmshift cusmshift) {
		getCusmshifts().add(cusmshift);
		cusmshift.setCustomer(this);

		return cusmshift;
	}

	public Cusmshift removeCusmshift(Cusmshift cusmshift) {
		getCusmshifts().remove(cusmshift);
		cusmshift.setCustomer(null);

		return cusmshift;
	}

	public Addresdetail getAddresdetail() {
		return this.addresdetail;
	}

	public void setAddresdetail(Addresdetail addresdetail) {
		this.addresdetail = addresdetail;
	}

	public Affix getAffix() {
		return this.affix;
	}

	public void setAffix(Affix affix) {
		this.affix = affix;
	}

	public Dictionary getDictionary1() {
		return this.dictionary1;
	}

	public void setDictionary1(Dictionary dictionary1) {
		this.dictionary1 = dictionary1;
	}

	public Dictionary getDictionary2() {
		return this.dictionary2;
	}

	public void setDictionary2(Dictionary dictionary2) {
		this.dictionary2 = dictionary2;
	}

	public Dictionary getDictionary3() {
		return this.dictionary3;
	}

	public void setDictionary3(Dictionary dictionary3) {
		this.dictionary3 = dictionary3;
	}

	public Dictionary getDictionary4() {
		return this.dictionary4;
	}

	public void setDictionary4(Dictionary dictionary4) {
		this.dictionary4 = dictionary4;
	}

	public Dictionary getDictionary5() {
		return this.dictionary5;
	}

	public void setDictionary5(Dictionary dictionary5) {
		this.dictionary5 = dictionary5;
	}

	public Dictionary getDictionary6() {
		return this.dictionary6;
	}

	public void setDictionary6(Dictionary dictionary6) {
		this.dictionary6 = dictionary6;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Customerconsolidation> getCustomerconsolidations1() {
		return this.customerconsolidations1;
	}

	public void setCustomerconsolidations1(List<Customerconsolidation> customerconsolidations1) {
		this.customerconsolidations1 = customerconsolidations1;
	}

	public Customerconsolidation addCustomerconsolidations1(Customerconsolidation customerconsolidations1) {
		getCustomerconsolidations1().add(customerconsolidations1);
		customerconsolidations1.setCustomer1(this);

		return customerconsolidations1;
	}

	public Customerconsolidation removeCustomerconsolidations1(Customerconsolidation customerconsolidations1) {
		getCustomerconsolidations1().remove(customerconsolidations1);
		customerconsolidations1.setCustomer1(null);

		return customerconsolidations1;
	}

	public List<Customerconsolidation> getCustomerconsolidations2() {
		return this.customerconsolidations2;
	}

	public void setCustomerconsolidations2(List<Customerconsolidation> customerconsolidations2) {
		this.customerconsolidations2 = customerconsolidations2;
	}

	public Customerconsolidation addCustomerconsolidations2(Customerconsolidation customerconsolidations2) {
		getCustomerconsolidations2().add(customerconsolidations2);
		customerconsolidations2.setCustomer2(this);

		return customerconsolidations2;
	}

	public Customerconsolidation removeCustomerconsolidations2(Customerconsolidation customerconsolidations2) {
		getCustomerconsolidations2().remove(customerconsolidations2);
		customerconsolidations2.setCustomer2(null);

		return customerconsolidations2;
	}

	public List<Deliveryschedule> getDeliveryschedules() {
		return this.deliveryschedules;
	}

	public void setDeliveryschedules(List<Deliveryschedule> deliveryschedules) {
		this.deliveryschedules = deliveryschedules;
	}

	public Deliveryschedule addDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().add(deliveryschedule);
		deliveryschedule.setCustomer(this);

		return deliveryschedule;
	}

	public Deliveryschedule removeDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().remove(deliveryschedule);
		deliveryschedule.setCustomer(null);

		return deliveryschedule;
	}

	public List<Demand> getDemands() {
		return this.demands;
	}

	public void setDemands(List<Demand> demands) {
		this.demands = demands;
	}

	public Demand addDemand(Demand demand) {
		getDemands().add(demand);
		demand.setCustomer(this);

		return demand;
	}

	public Demand removeDemand(Demand demand) {
		getDemands().remove(demand);
		demand.setCustomer(null);

		return demand;
	}

	public List<Linkman> getLinkmans() {
		return this.linkmans;
	}

	public void setLinkmans(List<Linkman> linkmans) {
		this.linkmans = linkmans;
	}

	public Linkman addLinkman(Linkman linkman) {
		getLinkmans().add(linkman);
		linkman.setCustomer(this);

		return linkman;
	}

	public Linkman removeLinkman(Linkman linkman) {
		getLinkmans().remove(linkman);
		linkman.setCustomer(null);

		return linkman;
	}

	public List<Node> getNodes() {
		return this.nodes;
	}

	public void setNodes(List<Node> nodes) {
		this.nodes = nodes;
	}

	public Node addNode(Node node) {
		getNodes().add(node);
		node.setCustomer(this);

		return node;
	}

	public Node removeNode(Node node) {
		getNodes().remove(node);
		node.setCustomer(null);

		return node;
	}

	public List<Offer> getOffers() {
		return this.offers;
	}

	public void setOffers(List<Offer> offers) {
		this.offers = offers;
	}

	public Offer addOffer(Offer offer) {
		getOffers().add(offer);
		offer.setCustomer(this);

		return offer;
	}

	public Offer removeOffer(Offer offer) {
		getOffers().remove(offer);
		offer.setCustomer(null);

		return offer;
	}

	public List<Opportunity> getOpportunitys() {
		return this.opportunitys;
	}

	public void setOpportunitys(List<Opportunity> opportunitys) {
		this.opportunitys = opportunitys;
	}

	public Opportunity addOpportunity(Opportunity opportunity) {
		getOpportunitys().add(opportunity);
		opportunity.setCustomer(this);

		return opportunity;
	}

	public Opportunity removeOpportunity(Opportunity opportunity) {
		getOpportunitys().remove(opportunity);
		opportunity.setCustomer(null);

		return opportunity;
	}

	public List<Orderform> getOrderforms() {
		return this.orderforms;
	}

	public void setOrderforms(List<Orderform> orderforms) {
		this.orderforms = orderforms;
	}

	public Orderform addOrderform(Orderform orderform) {
		getOrderforms().add(orderform);
		orderform.setCustomer(this);

		return orderform;
	}

	public Orderform removeOrderform(Orderform orderform) {
		getOrderforms().remove(orderform);
		orderform.setCustomer(null);

		return orderform;
	}

	public List<Orderlog> getOrderlogs() {
		return this.orderlogs;
	}

	public void setOrderlogs(List<Orderlog> orderlogs) {
		this.orderlogs = orderlogs;
	}

	public Orderlog addOrderlog(Orderlog orderlog) {
		getOrderlogs().add(orderlog);
		orderlog.setCustomer(this);

		return orderlog;
	}

	public Orderlog removeOrderlog(Orderlog orderlog) {
		getOrderlogs().remove(orderlog);
		orderlog.setCustomer(null);

		return orderlog;
	}

	public List<Repairlist> getRepairlists() {
		return this.repairlists;
	}

	public void setRepairlists(List<Repairlist> repairlists) {
		this.repairlists = repairlists;
	}

	public Repairlist addRepairlist(Repairlist repairlist) {
		getRepairlists().add(repairlist);
		repairlist.setCustomer(this);

		return repairlist;
	}

	public Repairlist removeRepairlist(Repairlist repairlist) {
		getRepairlists().remove(repairlist);
		repairlist.setCustomer(null);

		return repairlist;
	}

	public List<Returne> getReturnes() {
		return this.returnes;
	}

	public void setReturnes(List<Returne> returnes) {
		this.returnes = returnes;
	}

	public Returne addReturne(Returne returne) {
		getReturnes().add(returne);
		returne.setCustomer(this);

		return returne;
	}

	public Returne removeReturne(Returne returne) {
		getReturnes().remove(returne);
		returne.setCustomer(null);

		return returne;
	}

	public List<Service> getServices() {
		return this.services;
	}

	public void setServices(List<Service> services) {
		this.services = services;
	}

	public Service addService(Service service) {
		getServices().add(service);
		service.setCustomer(this);

		return service;
	}

	public Service removeService(Service service) {
		getServices().remove(service);
		service.setCustomer(null);

		return service;
	}

	public List<Solution> getSolutions() {
		return this.solutions;
	}

	public void setSolutions(List<Solution> solutions) {
		this.solutions = solutions;
	}

	public Solution addSolution(Solution solution) {
		getSolutions().add(solution);
		solution.setCustomer(this);

		return solution;
	}

	public Solution removeSolution(Solution solution) {
		getSolutions().remove(solution);
		solution.setCustomer(null);

		return solution;
	}

	public List<Logforcust> getLogforcust() {
		return logforcust;
	}

	public void setLogforcust(List<Logforcust> logforcust) {
		this.logforcust = logforcust;
	}
	
	
	public Logforcust addLogforcust(Logforcust logforcust) {
		getLogforcust().add(logforcust);
		logforcust.setCustomer(this);
		return logforcust;
	}

	public Logforcust removeSolution(Logforcust logforcust) {
		getLogforcust().remove(logforcust);
		logforcust.setCustomer(null);
		return logforcust;
	}


	@Override
	public String toString() {
		return "Customer [cusId=" + cusId + ", cusCompany=" + cusCompany + ", cusName=" + cusName + ", cusShow="
				+ cusShow + "]";
	}
	
	

}